#if !defined keymotiomheadfile 
#define keymotiomheadfile 

void keydn(int); 
void keyup(int); 
void wordup(int); 

//int color[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
void keydn(int plc) 
{ 
	int x,y; 
	if(plc==-1)return; 
	if(plc>=0&&plc<30) 
	{ 
		x=(plc%10)*40+110-15*(plc/10); 
		y=200-40*(plc/10); 
	} 
	else if(plc>29) 
	{ 
		x=15*(plc==30)+480+40*(plc!=30)*(plc%3-1); 
		y=160-(plc!=30)*40; 
	} 
	buttondn(x,y,x+30,y+30); 
} 

void keyup(int plc) 
{ 
	int x,y; 
	if(plc==-1)return; 
	if(plc>=0&&plc<30) 
	{ 
		x=(plc%10)*40+110-15*(plc/10); 
		y=200-40*(plc/10); 
	} 
	else if(plc>29) 
	{ 
		x=15*(plc==30)+480+40*(plc!=30)*(plc%3-1); 
		y=160-(plc!=30)*40; 
	} 
	buttonup(x,y,x+30,y+30); 
} 

void wordup(int plc) 
{ 
	int x,y,py=plc; 
	char s[2]; 
	char *keyboard[]={"Z","X","C","V","B","N","M",",","\.","\/", 
		"A","S","D","F","G","H","J","K","L",";", 
		"Q","W","E","R","T","Y","U","I","O","P","\'","[","]"}; 
	if(plc==-1)return; 
	if(plc>=0&&plc<30) 
	{ 
		x=(plc%10)*40+110-15*(plc/10); 
		y=200-40*(plc/10); 
	} 
	else if(plc>29) 
	{ 
		x=15*(plc==30)+480+40*(plc!=30)*(plc%3-1); 
		y=160-(plc!=30)*40; 
		py=plc+2+(plc==30); 
	} 
	setcolor(color[14]); 
	sprintf(s,"%d",(py%10)%7+1); 
	if(plc<7)outtextxy(x+5,y+11,"\."); 
	if(plc>16)outtextxy(x+5,y,"."); 
	if(plc>26&&plc!=30)outtextxy(x+5,y-3,"."); 
	outtextxy(x+5,y+8,s); 
	setcolor(color[15]); 
	outtextxy(x+18,y+20,keyboard[plc]); 
	/*setcolor(color[8]); 
	outtextxy(x+17,y+19,keyboard[plc]);*/ 
} 
#endif 



/*end of kmotion.h*/ 